package com.gourd.common.rbac.service;

import com.alicp.jetcache.anno.CacheType;
import com.alicp.jetcache.anno.Cached;
import com.baomidou.mybatisplus.service.IService;
import com.gourd.common.rbac.entity.RbacRole;

import java.util.List;

/**
 * 角色
 *
 * @author gourd
 * @date 2019-04-02 17:26:16
 * Created by CodeGen .
 */
public interface RbacRoleService extends IService<RbacRole> {

    @Cached(name = "roleService.getByCode",cacheType = CacheType.BOTH)
    RbacRole getByCode(String code);

    List<RbacRole> findByCodes(List<String> codes);

    @Cached(name = "roleService.findByUserId",cacheType = CacheType.BOTH)
    List<RbacRole> findByUserId(Long userId);


}